<?php
if (!defined('APP_PATH')) {
	define('APP_PATH', $_SERVER['DOCUMENT_ROOT']."/bdACPA");
}
require_once(APP_PATH.'/required.php');


$idCNV= intval($_REQUEST["idCNV"]);
$idPuce= intval($_REQUEST["idPuce"]);
//set content type and xml tag
header("Content-type:text/xml");
echo("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
$cnv = null;
$out = "";
if ($idCNV != 0 ){
	$cnv = $CNV_DAO->recuperer_CNV_par_idCNV($idCNV);
	print("<data>");
	$out .="<idcnv>";
	$out .=intval(html_entity_decode(stripcslashes($cnv->idcnv)));
	$out .="</idcnv>";
	$out .="<idpuce>";
	$out .=intval(html_entity_decode(stripcslashes($cnv->idpuce)));
	$out .="</idpuce>";
	$out .="<chromosome>";
	$out .=intval(html_entity_decode(stripcslashes($cnv->chromosome)));
	$out .="</chromosome>";
	$out .="<positiondebut>";
	$out .=intval(html_entity_decode(stripcslashes($cnv->positiondebut)));
	$out .="</positiondebut>";
	$out .="<positionfin>";
	$out .=intval(html_entity_decode(stripcslashes($cnv->positionfin)));
	$out .="</positionfin>";
	$out .="<sondedebut>";
	$out .=html_entity_decode(stripcslashes($cnv->sondedebut));
	$out .="</sondedebut>";
	$out .="<sondefin>";
	$out .=html_entity_decode(stripcslashes($cnv->sondedebut));
	$out .="</sondefin>";
	$out .="<log2ratio>";
	$out .=doubleval(html_entity_decode(stripcslashes($cnv->log2ratio)));
	$out .="</log2ratio>";	
	$out .="<nbcopie>";
	$out .=intval(html_entity_decode(stripcslashes($cnv->nbcopie)));
	$out .="</nbcopie>";	
	$out .="<classification>";
	$out .=intval(html_entity_decode(stripcslashes($cnv->classification)));
	$out .="</classification>";	
	$out .="<commentaire>";
	$out .=html_entity_decode(stripcslashes($cnv->commentaire));
	$out .="</commentaire>";	
	$out .="<herite>";
	$out .=intval(html_entity_decode(stripcslashes($cnv->herite)));
	$out .="</herite>";	
	$out .="<verifie>";
	$out .=intval(html_entity_decode(stripcslashes($cnv->verifie)));
	$out .="</verifie>";	
	$out .="<methode>";
	$out .=intval(html_entity_decode(stripcslashes($cnv->methodeverification)));
	$out .="</methode>";

	print($out);
	print("</data>");

} else {
	print("<data>");
	$out .="<idcnv>0";
	$out .="</idcnv>";
	$out .="<idpuce>";
	$out .= $idPuce;
	$out .="</idpuce>";
	$out .="<chromosome>0";
	$out .="</chromosome>";
	$out .="<positiondebut>";
	$out .="</positiondebut>";
	$out .="<positionfin>";
	$out .="</positionfin>";
	$out .="<sondedebut>";
	$out .="</sondedebut>";
	$out .="<sondefin>";
	$out .="</sondefin>";
	$out .="<log2ratio>";
	$out .="</log2ratio>";	
	$out .="<nbcopie>";
	$out .="</nbcopie>";	
	$out .="<classification>1";
	$out .="</classification>";	
	$out .="<commentaire>";
	$out .="</commentaire>";	
	$out .="<herite>";
	$out .="</herite>";	
	$out .="<verifie>";
	$out .="</verifie>";	
	$out .="<methode>";
	$out .="</methode>";

	print($out);
	print("</data>");

}
?>
